#ifndef _RETRO_PLAYER_EVENTQUEUE
#define _RETRO_PLAYER_EVENTQUEUE

#include "player.graphic.h"

#define EVENT_DURATION_INFINITE   (-1)

namespace Retro
{
  namespace Player
  {
    namespace Graphic
    {
      struct Event
      {
        INT   delay;
        INT   duration;

        PTSTR callbackEnter;
        PTSTR callbackFrame;
        PTSTR callbackLeave;
      };

      class EventQueue : public IGraphic
      {
      private:
        Generic::Vector<Event*> mBuffer;

      public:
        UINT  add(Event& iEvent);
        VOID  remove(UINT iIndex);
        UINT  getLength()
        {
          return mBuffer.getLength();
        }

        EventQueue();

        INL Event* operator[](UINT iIndex)
        {
          return mBuffer[iIndex];
        }

        VOID init(Display::DisplayDevice* iDevice);
        VOID uninit(Display::DisplayDevice* iDevice);
      };
    }
  }
}

#endif
